package com.heather.exam.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.injector.methods.Insert;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heather.exam.pojo.table.Code_suit;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CodeMapper extends BaseMapper<Code_suit> {
    int insert(Code_suit code_suit);
    @Select("SELECT * FROM code_suit WHERE email = #{email}")
    List<Code_suit> selectEmail(@Param("email") String email);

    @Select("SELECT code FROM code_suit WHERE email = #{email}")
    String getCode(String email);

    @Delete("DELETE FROM code_suit WHERE email = #{email}")
    int deleteByEmail(String email);
}
